/**
 * @file    sha256.c
 * @brief   Common SHA256 test functions for Ockam Vault
 */

#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>

#include "cmocka.h"
#include "ockam/error.h"
#include "ockam/memory.h"
#include "ockam/vault.h"
#include "test_vault.h"

#define TEST_VAULT_SHA256_TEST_CASES  65u
#define TEST_VAULT_SHA256_NAME_SIZE   32u
#define TEST_VAULT_SHA256_DIGEST_SIZE 32u

/**
 * @struct  test_vault_sha256_data_t
 * @brief   NIST Test values
 */
typedef struct {
  uint32_t len;
  uint8_t  msg[64];
  uint8_t  digest[32];
} test_vault_sha256_data_t;

/**
 * @struct  test_vault_sha256_shared_data_t
 * @brief   Shared test data for all unit tests
 */
typedef struct {
  uint16_t        test_count;
  uint16_t        test_count_max;
  ockam_vault_t*  vault;
  ockam_memory_t* memory;
} test_vault_sha256_shared_data_t;

void test_vault_sha256(void** state);
int  test_vault_sha256_teardown(void** state);

/* clang-format off */

test_vault_sha256_data_t g_sha256_data[] =
{
    {
        0,
        {
            0x00
        },
        {
            0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14,
            0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24,
            0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c,
            0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55
        }
    },
    {
        8,
        {
            0xd3,
        },
        {
            0x28, 0x96, 0x9c, 0xdf, 0xa7, 0x4a, 0x12, 0xc8,
            0x2f, 0x3b, 0xad, 0x96, 0x0b, 0x0b, 0x00, 0x0a,
            0xca, 0x2a, 0xc3, 0x29, 0xde, 0xea, 0x5c, 0x23,
            0x28, 0xeb, 0xc6, 0xf2, 0xba, 0x98, 0x02, 0xc1
        }
    },
    {
        16,
        {
            0x11, 0xaf
        },
        {
            0x5c, 0xa7, 0x13, 0x3f, 0xa7, 0x35, 0x32, 0x60,
            0x81, 0x55, 0x8a, 0xc3, 0x12, 0xc6, 0x20, 0xee,
            0xca, 0x99, 0x70, 0xd1, 0xe7, 0x0a, 0x4b, 0x95,
            0x53, 0x3d, 0x95, 0x6f, 0x07, 0x2d, 0x1f, 0x98
        }
    },

    {
        24,
        {
            0xb4, 0x19, 0x0e
        },
        {
            0xdf, 0xf2, 0xe7, 0x30, 0x91, 0xf6, 0xc0, 0x5e,
            0x52, 0x88, 0x96, 0xc4, 0xc8, 0x31, 0xb9, 0x44,
            0x86, 0x53, 0xdc, 0x2f, 0xf0, 0x43, 0x52, 0x8f,
            0x67, 0x69, 0x43, 0x7b, 0xc7, 0xb9, 0x75, 0xc2
        }
    },
    {
        32,
        {
            0x74, 0xba, 0x25, 0x21
        },
        {
            0xb1, 0x6a, 0xa5, 0x6b, 0xe3, 0x88, 0x0d, 0x18,
            0xcd, 0x41, 0xe6, 0x83, 0x84, 0xcf, 0x1e, 0xc8,
            0xc1, 0x76, 0x80, 0xc4, 0x5a, 0x02, 0xb1, 0x57,
            0x5d, 0xc1, 0x51, 0x89, 0x23, 0xae, 0x8b, 0x0e
        }
    },

    {
        40,
        {
            0xc2, 0x99, 0x20, 0x96, 0x82
        },
        {
            0xf0, 0x88, 0x7f, 0xe9, 0x61, 0xc9, 0xcd, 0x3b,
            0xea, 0xb9, 0x57, 0xe8, 0x22, 0x24, 0x94, 0xab,
            0xb9, 0x69, 0xb1, 0xce, 0x4c, 0x65, 0x57, 0x97,
            0x6d, 0xf8, 0xb0, 0xf6, 0xd2, 0x0e, 0x91, 0x66
        }
    },
    {
        48,
        {
            0xe1, 0xdc, 0x72, 0x4d, 0x56, 0x21
        },
        {
            0xec, 0xa0, 0xa0, 0x60, 0xb4, 0x89, 0x63, 0x62,
            0x25, 0xb4, 0xfa, 0x64, 0xd2, 0x67, 0xda, 0xbb,
            0xe4, 0x42, 0x73, 0x06, 0x7a, 0xc6, 0x79, 0xf2,
            0x08, 0x20, 0xbd, 0xdc, 0x6b, 0x6a, 0x90, 0xac
        }
    },

    {
        56,
        {
            0x06, 0xe0, 0x76, 0xf5, 0xa4, 0x42, 0xd5
        },
        {
            0x3f, 0xd8, 0x77, 0xe2, 0x74, 0x50, 0xe6, 0xbb,
            0xd5, 0xd7, 0x4b, 0xb8, 0x2f, 0x98, 0x70, 0xc6,
            0x4c, 0x66, 0xe1, 0x09, 0x41, 0x8b, 0xaa, 0x8e,
            0x6b, 0xbc, 0xff, 0x35, 0x5e, 0x28, 0x79, 0x26
        }
    },

    {
        64,
        {
            0x57, 0x38, 0xc9, 0x29, 0xc4, 0xf4, 0xcc, 0xb6
        },
        {
            0x96, 0x3b, 0xb8, 0x8f, 0x27, 0xf5, 0x12, 0x77,
            0x7a, 0xab, 0x6c, 0x8b, 0x1a, 0x02, 0xc7, 0x0e,
            0xc0, 0xad, 0x65, 0x1d, 0x42, 0x8f, 0x87, 0x00,
            0x36, 0xe1, 0x91, 0x71, 0x20, 0xfb, 0x48, 0xbf
        }
    },
    {
        72,
        {
            0x33, 0x34, 0xc5, 0x80, 0x75, 0xd3, 0xf4, 0x13,
            0x9e
        },
        {
            0x07, 0x8d, 0xa3, 0xd7, 0x7e, 0xd4, 0x3b, 0xd3,
            0x03, 0x7a, 0x43, 0x3f, 0xd0, 0x34, 0x18, 0x55,
            0x02, 0x37, 0x93, 0xf9, 0xaf, 0xd0, 0x8b, 0x4b,
            0x08, 0xea, 0x1e, 0x55, 0x97, 0xce, 0xef, 0x20
        }
    },
    {
        80,
        {
            0x74, 0xcb, 0x93, 0x81, 0xd8, 0x9f, 0x5a, 0xa7,
            0x33, 0x68
        },
        {
            0x73, 0xd6, 0xfa, 0xd1, 0xca, 0xaa, 0x75, 0xb4,
            0x3b, 0x21, 0x73, 0x35, 0x61, 0xfd, 0x39, 0x58,
            0xbd, 0xc5, 0x55, 0x19, 0x4a, 0x03, 0x7c, 0x2a,
            0xdd, 0xec, 0x19, 0xdc, 0x2d, 0x7a, 0x52, 0xbd
        }
    },
    {
        88,
        {
            0x76, 0xed, 0x24, 0xa0, 0xf4, 0x0a, 0x41, 0x22,
            0x1e, 0xbf, 0xcf
        },
        {
            0x04, 0x4c, 0xef, 0x80, 0x29, 0x01, 0x93, 0x2e,
            0x46, 0xdc, 0x46, 0xb2, 0x54, 0x5e, 0x6c, 0x99,
            0xc0, 0xfc, 0x32, 0x3a, 0x0e, 0xd9, 0x9b, 0x08,
            0x1b, 0xda, 0x42, 0x16, 0x85, 0x7f, 0x38, 0xac
        }
    },

    {
        96,
        {
            0x9b, 0xaf, 0x69, 0xcb, 0xa3, 0x17, 0xf4, 0x22,
            0xfe, 0x26, 0xa9, 0xa0
        },
        {
            0xfe, 0x56, 0x28, 0x7c, 0xd6, 0x57, 0xe4, 0xaf,
            0xc5, 0x0d, 0xba, 0x7a, 0x3a, 0x54, 0xc2, 0xa6,
            0x32, 0x4b, 0x88, 0x6b, 0xec, 0xdc, 0xd1, 0xfa,
            0xe4, 0x73, 0xb7, 0x69, 0xe5, 0x51, 0xa0, 0x9b
        }
    },
    {
        104,
        {
            0x68, 0x51, 0x1c, 0xdb, 0x2d, 0xbb, 0xf3, 0x53,
            0x0d, 0x7f, 0xb6, 0x1c, 0xbc
        },
        {
            0xaf, 0x53, 0x43, 0x04, 0x66, 0x71, 0x5e, 0x99,
            0xa6, 0x02, 0xfc, 0x9f, 0x59, 0x45, 0x71, 0x9b,
            0x04, 0xdd, 0x24, 0x26, 0x7e, 0x6a, 0x98, 0x47,
            0x1f, 0x7a, 0x78, 0x69, 0xbd, 0x3b, 0x43, 0x13
        }
    },
    {
        112,
        {
            0xaf, 0x39, 0x7a, 0x8b, 0x8d, 0xd7, 0x3a, 0xb7,
            0x02, 0xce, 0x8e, 0x53, 0xaa, 0x9f
        },
        {
            0xd1, 0x89, 0x49, 0x8a, 0x34, 0x63, 0xb1, 0x8e,
            0x84, 0x6b, 0x8a, 0xb1, 0xb4, 0x15, 0x83, 0xb0,
            0xb7, 0xef, 0xc7, 0x89, 0xda, 0xd8, 0xa7, 0xfb,
            0x88, 0x5b, 0xbf, 0x8f, 0xb5, 0xb4, 0x5c, 0x5c
        }
    },
    {
        120,
        {
            0x29, 0x4a, 0xf4, 0x80, 0x2e, 0x5e, 0x92, 0x5e,
            0xb1, 0xc6, 0xcc, 0x9c, 0x72, 0x4f, 0x09
        },
        {
            0xdc, 0xba, 0xf3, 0x35, 0x36, 0x0d, 0xe8, 0x53,
            0xb9, 0xcd, 0xdf, 0xda, 0xfb, 0x90, 0xfa, 0x75,
            0x56, 0x7d, 0x0d, 0x3d, 0x58, 0xaf, 0x8d, 0xb9,
            0xd7, 0x64, 0x11, 0x3a, 0xef, 0x57, 0x01, 0x25
        }
    },
    {
        128,
        {
            0x0a, 0x27, 0x84, 0x7c, 0xdc, 0x98, 0xbd, 0x6f,
            0x62, 0x22, 0x0b, 0x04, 0x6e, 0xdd, 0x76, 0x2b
        },
        {
            0x80, 0xc2, 0x5e, 0xc1, 0x60, 0x05, 0x87, 0xe7,
            0xf2, 0x8b, 0x18, 0xb1, 0xb1, 0x8e, 0x3c, 0xdc,
            0x89, 0x92, 0x8e, 0x39, 0xca, 0xb3, 0xbc, 0x25,
            0xe4, 0xd4, 0xa4, 0xc1, 0x39, 0xbc, 0xed, 0xc4
        }
    },
    {
        136,
        {
            0x1b, 0x50, 0x3f, 0xb9, 0xa7, 0x3b, 0x16, 0xad,
            0xa3, 0xfc, 0xf1, 0x04, 0x26, 0x23, 0xae, 0x76,
            0x10
        },
        {
            0xd5, 0xc3, 0x03, 0x15, 0xf7, 0x2e, 0xd0, 0x5f,
            0xe5, 0x19, 0xa1, 0xbf, 0x75, 0xab, 0x5f, 0xd0,
            0xff, 0xec, 0x5a, 0xc1, 0xac, 0xb0, 0xda, 0xf6,
            0x6b, 0x6b, 0x76, 0x95, 0x98, 0x59, 0x45, 0x09
        }
    },
    {
        144,
        {
            0x59, 0xeb, 0x45, 0xbb, 0xbe, 0xb0, 0x54, 0xb0,
            0xb9, 0x73, 0x34, 0xd5, 0x35, 0x80, 0xce, 0x03,
            0xf6, 0x99
        },
        {
            0x32, 0xc3, 0x8c, 0x54, 0x18, 0x9f, 0x23, 0x57,
            0xe9, 0x6b, 0xd7, 0x7e, 0xb0, 0x0c, 0x2b, 0x9c,
            0x34, 0x1e, 0xbe, 0xba, 0xcc, 0x29, 0x45, 0xf9,
            0x78, 0x04, 0xf5, 0x9a, 0x93, 0x23, 0x82, 0x88
        }
    },
    {
        152,
        {
            0x58, 0xe5, 0xa3, 0x25, 0x9c, 0xb0, 0xb6, 0xd1,
            0x2c, 0x83, 0xf7, 0x23, 0x37, 0x9e, 0x35, 0xfd,
            0x29, 0x8b, 0x60
        },
        {
            0x9b, 0x5b, 0x37, 0x81, 0x6d, 0xe8, 0xfc, 0xdf,
            0x3e, 0xc1, 0x0b, 0x74, 0x54, 0x28, 0x70, 0x8d,
            0xf8, 0xf3, 0x91, 0xc5, 0x50, 0xea, 0x67, 0x46,
            0xb2, 0xca, 0xfe, 0x01, 0x9c, 0x2b, 0x6a, 0xce
        }
    },
    {
        160,
        {
            0xc1, 0xef, 0x39, 0xce, 0xe5, 0x8e, 0x78, 0xf6,
            0xfc, 0xdc, 0x12, 0xe0, 0x58, 0xb7, 0xf9, 0x02,
            0xac, 0xd1, 0xa9, 0x3b
        },
        {
            0x6d, 0xd5, 0x2b, 0x0d, 0x8b, 0x48, 0xcc, 0x81,
            0x46, 0xce, 0xbd, 0x02, 0x16, 0xfb, 0xf5, 0xf6,
            0xef, 0x7e, 0xea, 0xfc, 0x0f, 0xf2, 0xff, 0x9d,
            0x14, 0x22, 0xd6, 0x34, 0x55, 0x55, 0xa1, 0x42
        }
    },
    {
        168,
        {
            0x9c, 0xab, 0x7d, 0x7d, 0xca, 0xec, 0x98, 0xcb,
            0x3a, 0xc6, 0xc6, 0x4d, 0xd5, 0xd4, 0x47, 0x0d,
            0x0b, 0x10, 0x3a, 0x81, 0x0c
        },
        {
            0x44, 0xd3, 0x48, 0x09, 0xfc, 0x60, 0xd1, 0xfc,
            0xaf, 0xa7, 0xf3, 0x7b, 0x79, 0x4d, 0x1d, 0x3a,
            0x76, 0x5d, 0xd0, 0xd2, 0x31, 0x94, 0xeb, 0xbe,
            0x34, 0x0f, 0x01, 0x3f, 0x0c, 0x39, 0xb6, 0x13
        }
    },
    {
        176,
        {
            0xea, 0x15, 0x7c, 0x02, 0xeb, 0xaf, 0x1b, 0x22,
            0xde, 0x22, 0x1b, 0x53, 0xf2, 0x35, 0x39, 0x36,
            0xd2, 0x35, 0x9d, 0x1e, 0x1c, 0x97
        },
        {
            0x9d, 0xf5, 0xc1, 0x6a, 0x3f, 0x58, 0x04, 0x06,
            0xf0, 0x7d, 0x96, 0x14, 0x93, 0x03, 0xd8, 0xc4,
            0x08, 0x86, 0x9b, 0x32, 0x05, 0x3b, 0x72, 0x6c,
            0xf3, 0xde, 0xfd, 0x24, 0x1e, 0x48, 0x49, 0x57
        }
    },
    {
        184,
        {
            0xda, 0x99, 0x9b, 0xc1, 0xf9, 0xc7, 0xac, 0xff,
            0x32, 0x82, 0x8a, 0x73, 0xe6, 0x72, 0xd0, 0xa4,
            0x92, 0xf6, 0xee, 0x89, 0x5c, 0x68, 0x67
        },
        {
            0x67, 0x2b, 0x54, 0xe4, 0x3f, 0x41, 0xee, 0x77,
            0x58, 0x4b, 0xdf, 0x8b, 0xf8, 0x54, 0xd9, 0x7b,
            0x62, 0x52, 0xc9, 0x18, 0xf7, 0xea, 0x2d, 0x26,
            0xbc, 0x40, 0x97, 0xea, 0x53, 0xa8, 0x8f, 0x10
        }
    },
    {
        192,
        {
            0x47, 0x99, 0x13, 0x01, 0x15, 0x6d, 0x1d, 0x97,
            0x7c, 0x03, 0x38, 0xef, 0xbc, 0xad, 0x41, 0x00,
            0x41, 0x33, 0xae, 0xfb, 0xca, 0x6b, 0xcf, 0x7e
        },
        {
            0xfe, 0xeb, 0x4b, 0x2b, 0x59, 0xfe, 0xc8, 0xfd,
            0xb1, 0xe5, 0x51, 0x94, 0xa4, 0x93, 0xd8, 0xc8,
            0x71, 0x75, 0x7b, 0x57, 0x23, 0x67, 0x5e, 0x93,
            0xd3, 0xac, 0x03, 0x4b, 0x38, 0x0b, 0x7f, 0xc9
        }
    },
    {
        200,
        {
            0x2e, 0x7e, 0xa8, 0x4d, 0xa4, 0xbc, 0x4d, 0x7c,
            0xfb, 0x46, 0x3e, 0x3f, 0x2c, 0x86, 0x47, 0x05,
            0x7a, 0xff, 0xf3, 0xfb, 0xec, 0xec, 0xa1, 0xd2,
            0x00
        },
        {
            0x76, 0xe3, 0xac, 0xbc, 0x71, 0x88, 0x36, 0xf2,
            0xdf, 0x8a, 0xd2, 0xd0, 0xd2, 0xd7, 0x6f, 0x0c,
            0xfa, 0x5f, 0xea, 0x09, 0x86, 0xbe, 0x91, 0x8f,
            0x10, 0xbc, 0xee, 0x73, 0x0d, 0xf4, 0x41, 0xb9
        }
    },
    {
        208,
        {
            0x47, 0xc7, 0x70, 0xeb, 0x45, 0x49, 0xb6, 0xef,
            0xf6, 0x38, 0x1d, 0x62, 0xe9, 0xbe, 0xb4, 0x64,
            0xcd, 0x98, 0xd3, 0x41, 0xcc, 0x1c, 0x09, 0x98,
            0x1a, 0x7a
        },
        {
            0x67, 0x33, 0x80, 0x9c, 0x73, 0xe5, 0x36, 0x66,
            0xc7, 0x35, 0xb3, 0xbd, 0x3d, 0xaf, 0x87, 0xeb,
            0xc7, 0x7c, 0x72, 0x75, 0x61, 0x50, 0xa6, 0x16,
            0xa1, 0x94, 0x10, 0x8d, 0x71, 0x23, 0x12, 0x72
        }
    },
    {
        216,
        {
            0xac, 0x4c, 0x26, 0xd8, 0xb4, 0x3b, 0x85, 0x79,
            0xd8, 0xf6, 0x1c, 0x98, 0x07, 0x02, 0x6e, 0x83,
            0xe9, 0xb5, 0x86, 0xe1, 0x15, 0x9b, 0xd4, 0x3b,
            0x85, 0x19, 0x37
        },
        {
            0x0e, 0x6e, 0x3c, 0x14, 0x3c, 0x3a, 0x5f, 0x7f,
            0x38, 0x50, 0x5e, 0xd6, 0xad, 0xc9, 0xb4, 0x8c,
            0x18, 0xed, 0xf6, 0xde, 0xdf, 0x11, 0x63, 0x5f,
            0x6e, 0x8f, 0x9a, 0xc7, 0x3c, 0x39, 0xfe, 0x9e
        }
    },
    {
        224,
        {
            0x07, 0x77, 0xfc, 0x1e, 0x1c, 0xa4, 0x73, 0x04,
            0xc2, 0xe2, 0x65, 0x69, 0x28, 0x38, 0x10, 0x9e,
            0x26, 0xaa, 0xb9, 0xe5, 0xc4, 0xae, 0x4e, 0x86,
            0x00, 0xdf, 0x4b, 0x1f
        },
        {
            0xff, 0xb4, 0xfc, 0x03, 0xe0, 0x54, 0xf8, 0xec,
            0xbc, 0x31, 0x47, 0x0f, 0xc0, 0x23, 0xbe, 0xdc,
            0xd4, 0xa4, 0x06, 0xb9, 0xdd, 0x56, 0xc7, 0x1d,
            0xa1, 0xb6, 0x60, 0xdc, 0xc4, 0x84, 0x2c, 0x65
        }
    },
    {
        232,
        {
            0x1a, 0x57, 0x25, 0x1c, 0x43, 0x1d, 0x4e, 0x6c,
            0x2e, 0x06, 0xd6, 0x52, 0x46, 0xa2, 0x96, 0x91,
            0x50, 0x71, 0xa5, 0x31, 0x42, 0x5e, 0xcf, 0x25,
            0x59, 0x89, 0x42, 0x2a, 0x66
        },
        {
            0xc6, 0x44, 0x61, 0x2c, 0xd3, 0x26, 0xb3, 0x8b,
            0x1c, 0x68, 0x13, 0xb1, 0xda, 0xde, 0xd3, 0x44,
            0x48, 0x80, 0x5a, 0xef, 0x31, 0x7c, 0x35, 0xf5,
            0x48, 0xdf, 0xb4, 0xa0, 0xd7, 0x4b, 0x81, 0x06
        }
    },
    {
        240,
        {
            0x9b, 0x24, 0x5f, 0xda, 0xd9, 0xba, 0xeb, 0x89,
            0x0d, 0x9c, 0x0d, 0x0e, 0xff, 0x81, 0x6e, 0xfb,
            0x4c, 0xa1, 0x38, 0x61, 0x0b, 0xc7, 0xd7, 0x8c,
            0xb1, 0xa8, 0x01, 0xed, 0x32, 0x73
        },
        {
            0xc0, 0xe2, 0x9e, 0xee, 0xb0, 0xd3, 0xa7, 0x70,
            0x79, 0x47, 0xe6, 0x23, 0xcd, 0xc7, 0xd1, 0x89,
            0x9a, 0xdc, 0x70, 0xdd, 0x78, 0x61, 0x20, 0x5e,
            0xa5, 0xe5, 0x81, 0x39, 0x54, 0xfb, 0x79, 0x57
        }
    },
    {
        248,
        {
            0x95, 0xa7, 0x65, 0x80, 0x9c, 0xaf, 0x30, 0xad,
            0xa9, 0x0a, 0xd6, 0xd6, 0x1c, 0x2b, 0x4b, 0x30,
            0x25, 0x0d, 0xf0, 0xa7, 0xce, 0x23, 0xb7, 0x75,
            0x3c, 0x91, 0x87, 0xf4, 0x31, 0x9c, 0xe2
        },
        {
            0xa4, 0x13, 0x9b, 0x74, 0xb1, 0x02, 0xcf, 0x1e,
            0x2f, 0xce, 0x22, 0x9a, 0x6c, 0xd8, 0x4c, 0x87,
            0x50, 0x1f, 0x50, 0xaf, 0xa4, 0xc8, 0x0f, 0xea,
            0xcf, 0x7d, 0x8c, 0xf5, 0xed, 0x94, 0xf0, 0x42
        }
    },
    {
        256,
        {
            0x09, 0xfc, 0x1a, 0xcc, 0xc2, 0x30, 0xa2, 0x05,
            0xe4, 0xa2, 0x08, 0xe6, 0x4a, 0x8f, 0x20, 0x42,
            0x91, 0xf5, 0x81, 0xa1, 0x27, 0x56, 0x39, 0x2d,
            0xa4, 0xb8, 0xc0, 0xcf, 0x5e, 0xf0, 0x2b, 0x95
        },
        {
            0x4f, 0x44, 0xc1, 0xc7, 0xfb, 0xeb, 0xb6, 0xf9,
            0x60, 0x18, 0x29, 0xf3, 0x89, 0x7b, 0xfd, 0x65,
            0x0c, 0x56, 0xfa, 0x07, 0x84, 0x4b, 0xe7, 0x64,
            0x89, 0x07, 0x63, 0x56, 0xac, 0x18, 0x86, 0xa4
        }
    },
    {
        264,
        {
            0x05, 0x46, 0xf7, 0xb8, 0x68, 0x2b, 0x5b, 0x95,
            0xfd, 0x32, 0x38, 0x5f, 0xaf, 0x25, 0x85, 0x4c,
            0xb3, 0xf7, 0xb4, 0x0c, 0xc8, 0xfa, 0x22, 0x9f,
            0xbd, 0x52, 0xb1, 0x69, 0x34, 0xaa, 0xb3, 0x88,
            0xa7
        },
        {
            0xb3, 0x1a, 0xd3, 0xcd, 0x02, 0xb1, 0x0d, 0xb2,
            0x82, 0xb3, 0x57, 0x6c, 0x05, 0x9b, 0x74, 0x6f,
            0xb2, 0x4c, 0xa6, 0xf0, 0x9f, 0xef, 0x69, 0x40,
            0x2d, 0xc9, 0x0e, 0xce, 0x74, 0x21, 0xcb, 0xb7
        }
    },
    {
        272,
        {
            0xb1, 0x2d, 0xb4, 0xa1, 0x02, 0x55, 0x29, 0xb3,
            0xb7, 0xb1, 0xe4, 0x5c, 0x6d, 0xbc, 0x7b, 0xaa,
            0x88, 0x97, 0xa0, 0x57, 0x6e, 0x66, 0xf6, 0x4b,
            0xf3, 0xf8, 0x23, 0x61, 0x13, 0xa6, 0x27, 0x6e,
            0xe7, 0x7d
        },
        {
            0x1c, 0x38, 0xbf, 0x6b, 0xbf, 0xd3, 0x22, 0x92,
            0xd6, 0x7d, 0x1d, 0x65, 0x1f, 0xd9, 0xd5, 0xb6,
            0x23, 0xb6, 0xec, 0x1e, 0x85, 0x44, 0x06, 0x22,
            0x3f, 0x51, 0xd0, 0xdf, 0x46, 0x96, 0x87, 0x12
        }
    },
    {
        280,
        {
            0xe6, 0x8c, 0xb6, 0xd8, 0xc1, 0x86, 0x6c, 0x0a,
            0x71, 0xe7, 0x31, 0x3f, 0x83, 0xdc, 0x11, 0xa5,
            0x80, 0x9c, 0xf5, 0xcf, 0xbe, 0xed, 0x1a, 0x58,
            0x7c, 0xe9, 0xc2, 0xc9, 0x2e, 0x02, 0x2a, 0xbc,
            0x16, 0x44, 0xbb
        },
        {
            0xc2, 0x68, 0x4c, 0x0d, 0xbb, 0x85, 0xc2, 0x32,
            0xb6, 0xda, 0x4f, 0xb5, 0x14, 0x7d, 0xd0, 0x62,
            0x44, 0x29, 0xec, 0x7e, 0x65, 0x79, 0x91, 0xed,
            0xd9, 0x5e, 0xda, 0x37, 0xa5, 0x87, 0x26, 0x9e
        }
    },
    {
        288,
        {
            0x4e, 0x3d, 0x8a, 0xc3, 0x6d, 0x61, 0xd9, 0xe5,
            0x14, 0x80, 0x83, 0x11, 0x55, 0xb2, 0x53, 0xb3,
            0x79, 0x69, 0xfe, 0x7e, 0xf4, 0x9d, 0xb3, 0xb3,
            0x99, 0x26, 0xf3, 0xa0, 0x0b, 0x69, 0xa3, 0x67,
            0x74, 0x36, 0x60, 0x00
        },
        {
            0xbf, 0x9d, 0x5e, 0x5b, 0x53, 0x93, 0x05, 0x3f,
            0x05, 0x5b, 0x38, 0x0b, 0xae, 0xd7, 0xe7, 0x92,
            0xae, 0x85, 0xad, 0x37, 0xc0, 0xad, 0xa5, 0xfd,
            0x45, 0x19, 0x54, 0x2c, 0xcc, 0x46, 0x1c, 0xf3
        }
    },
    {
        296,
        {
            0x03, 0xb2, 0x64, 0xbe, 0x51, 0xe4, 0xb9, 0x41,
            0x86, 0x4f, 0x9b, 0x70, 0xb4, 0xc9, 0x58, 0xf5,
            0x35, 0x5a, 0xac, 0x29, 0x4b, 0x4b, 0x87, 0xcb,
            0x03, 0x7f, 0x11, 0xf8, 0x5f, 0x07, 0xeb, 0x57,
            0xb3, 0xf0, 0xb8, 0x95, 0x50
        },
        {
            0xd1, 0xf8, 0xbd, 0x68, 0x40, 0x01, 0xac, 0x5a,
            0x4b, 0x67, 0xbb, 0xf7, 0x9f, 0x87, 0xde, 0x52,
            0x4d, 0x2d, 0xa9, 0x9a, 0xc0, 0x14, 0xde, 0xc3,
            0xe4, 0x18, 0x77, 0x28, 0xf4, 0x55, 0x74, 0x71
        }
    },
    {
        304,
        {
            0xd0, 0xfe, 0xfd, 0x96, 0x78, 0x7c, 0x65, 0xff,
            0xa7, 0xf9, 0x10, 0xd6, 0xd0, 0xad, 0xa6, 0x3d,
            0x64, 0xd5, 0xc4, 0x67, 0x99, 0x60, 0xe7, 0xf0,
            0x6a, 0xeb, 0x8c, 0x70, 0xdf, 0xef, 0x95, 0x4f,
            0x8e, 0x39, 0xef, 0xdb, 0x62, 0x9b
        },
        {
            0x49, 0xba, 0x38, 0xdb, 0x85, 0xc2, 0x79, 0x6f,
            0x85, 0xff, 0xd5, 0x7d, 0xd5, 0xec, 0x33, 0x70,
            0x07, 0x41, 0x45, 0x28, 0xae, 0x33, 0x93, 0x5b,
            0x10, 0x2d, 0x16, 0xa6, 0xb9, 0x1b, 0xa6, 0xc1
        }
    },
    {
        312,
        {
            0xb7, 0xc7, 0x9d, 0x7e, 0x5f, 0x1e, 0xec, 0xcd,
            0xfe, 0xdf, 0x0e, 0x7b, 0xf4, 0x3e, 0x73, 0x0d,
            0x44, 0x7e, 0x60, 0x7d, 0x8d, 0x14, 0x89, 0x82,
            0x3d, 0x09, 0xe1, 0x12, 0x01, 0xa0, 0xb1, 0x25,
            0x80, 0x39, 0xe7, 0xbd, 0x48, 0x75, 0xb1
        },
        {
            0x72, 0x5e, 0x6f, 0x8d, 0x88, 0x8e, 0xba, 0xf9,
            0x08, 0xb7, 0x69, 0x22, 0x59, 0xab, 0x88, 0x39,
            0xc3, 0x24, 0x8e, 0xdd, 0x22, 0xca, 0x11, 0x5b,
            0xb1, 0x3e, 0x02, 0x58, 0x08, 0x65, 0x47, 0x00
        }
    },
    {
        320,
        {
            0x64, 0xcd, 0x36, 0x3e, 0xcc, 0xe0, 0x5f, 0xdf,
            0xda, 0x24, 0x86, 0xd0, 0x11, 0xa3, 0xdb, 0x95,
            0xb5, 0x20, 0x6a, 0x19, 0xd3, 0x05, 0x40, 0x46,
            0x81, 0x9d, 0xd0, 0xd3, 0x67, 0x83, 0x95, 0x5d,
            0x7e, 0x5b, 0xf8, 0xba, 0x18, 0xbf, 0x73, 0x8a
        },
        {
            0x32, 0xca, 0xef, 0x02, 0x4f, 0x84, 0xe9, 0x7c,
            0x30, 0xb4, 0xa7, 0xb9, 0xd0, 0x4b, 0x67, 0x8b,
            0x3d, 0x8a, 0x6e, 0xb2, 0x25, 0x9d, 0xff, 0x5b,
            0x7f, 0x7c, 0x01, 0x1f, 0x09, 0x08, 0x45, 0xf8
        }
    },
    {
        328,
        {
            0x6a, 0xc6, 0xc6, 0x3d, 0x61, 0x8e, 0xaf, 0x00,
            0xd9, 0x1c, 0x5e, 0x28, 0x07, 0xe8, 0x3c, 0x09,
            0x39, 0x12, 0xb8, 0xe2, 0x02, 0xf7, 0x8e, 0x13,
            0x97, 0x03, 0x49, 0x8a, 0x79, 0xc6, 0x06, 0x7f,
            0x54, 0x49, 0x7c, 0x61, 0x27, 0xa2, 0x39, 0x10,
            0xa6
        },
        {
            0x4b, 0xb3, 0x3e, 0x7c, 0x69, 0x16, 0xe0, 0x8a,
            0x9b, 0x3e, 0xd6, 0xbc, 0xef, 0x79, 0x0a, 0xaa,
            0xee, 0x0d, 0xcf, 0x2e, 0x7a, 0x01, 0xaf, 0xb0,
            0x56, 0x18, 0x2d, 0xea, 0x2d, 0xad, 0x7d, 0x63
        }
    },
    {
        336,
        {
            0xd2, 0x68, 0x26, 0xdb, 0x9b, 0xae, 0xaa, 0x89,
            0x26, 0x91, 0xb6, 0x89, 0x00, 0xb9, 0x61, 0x63,
            0x20, 0x8e, 0x80, 0x6a, 0x1d, 0xa0, 0x77, 0x42,
            0x9e, 0x45, 0x4f, 0xa0, 0x11, 0x84, 0x09, 0x51,
            0xa0, 0x31, 0x32, 0x7e, 0x60, 0x5a, 0xb8, 0x2e,
            0xcc, 0xe2
        },
        {
            0x3a, 0xc7, 0xac, 0x6b, 0xed, 0x82, 0xfd, 0xc8,
            0xcd, 0x15, 0xb7, 0x46, 0xf0, 0xee, 0x74, 0x89,
            0x15, 0x81, 0x92, 0xc2, 0x38, 0xf3, 0x71, 0xc1,
            0x88, 0x3c, 0x9f, 0xe9, 0x0b, 0x3e, 0x28, 0x31
        }
    },
    {
        344,
        {
            0x3f, 0x7a, 0x05, 0x9b, 0x65, 0xd6, 0xcb, 0x02,
            0x49, 0x20, 0x4a, 0xac, 0x10, 0xb9, 0xf1, 0xa4,
            0xac, 0x9e, 0x58, 0x68, 0xad, 0xeb, 0xbe, 0x93,
            0x5a, 0x9e, 0xb5, 0xb9, 0x01, 0x9e, 0x1c, 0x93,
            0x8b, 0xfc, 0x4e, 0x5c, 0x53, 0x78, 0x99, 0x7a,
            0x39, 0x47, 0xf2
        },
        {
            0xbf, 0xce, 0x80, 0x95, 0x34, 0xee, 0xfe, 0x87,
            0x12, 0x73, 0x96, 0x4d, 0x32, 0xf0, 0x91, 0xfe,
            0x75, 0x6c, 0x71, 0xa7, 0xf5, 0x12, 0xef, 0x5f,
            0x23, 0x00, 0xbc, 0xd5, 0x7f, 0x69, 0x9e, 0x74
        }
    },
    {
        352,
        {
            0x60, 0xff, 0xcb, 0x23, 0xd6, 0xb8, 0x8e, 0x48,
            0x5b, 0x92, 0x0a, 0xf8, 0x1d, 0x10, 0x83, 0xf6,
            0x29, 0x1d, 0x06, 0xac, 0x8c, 0xa3, 0xa9, 0x65,
            0xb8, 0x59, 0x14, 0xbc, 0x2a, 0xdd, 0x40, 0x54,
            0x4a, 0x02, 0x7f, 0xca, 0x93, 0x6b, 0xbd, 0xe8,
            0xf3, 0x59, 0x05, 0x1c
        },
        {
            0x1d, 0x26, 0xf3, 0xe0, 0x4f, 0x89, 0xb4, 0xea,
            0xa9, 0xdb, 0xed, 0x92, 0x31, 0xbb, 0x05, 0x1e,
            0xef, 0x2e, 0x83, 0x11, 0xad, 0x26, 0xfe, 0x53,
            0xd0, 0xbf, 0x0b, 0x82, 0x1e, 0xaf, 0x75, 0x67
        }
    },
    {
        360,
        {
            0x9e, 0xcd, 0x07, 0xb6, 0x84, 0xbb, 0x9e, 0x0e,
            0x66, 0x92, 0xe3, 0x20, 0xce, 0xc4, 0x51, 0x0c,
            0xa7, 0x9f, 0xcd, 0xb3, 0xa2, 0x21, 0x2c, 0x26,
            0xd9, 0x0d, 0xf6, 0x5d, 0xb3, 0x3e, 0x69, 0x2d,
            0x07, 0x3c, 0xc1, 0x74, 0x84, 0x0d, 0xb7, 0x97,
            0x50, 0x4e, 0x48, 0x2e, 0xef
        },
        {
            0x0f, 0xfe, 0xb6, 0x44, 0xa4, 0x9e, 0x78, 0x7c,
            0xcc, 0x69, 0x70, 0xfe, 0x29, 0x70, 0x5a, 0x4f,
            0x4c, 0x2b, 0xfc, 0xfe, 0x7d, 0x19, 0x74, 0x1c,
            0x15, 0x83, 0x33, 0xff, 0x69, 0x82, 0xcc, 0x9c
        }
    },
    {
        368,
        {
            0x9d, 0x64, 0xde, 0x71, 0x61, 0x89, 0x58, 0x84,
            0xe7, 0xfa, 0x3d, 0x6e, 0x9e, 0xb9, 0x96, 0xe7,
            0xeb, 0xe5, 0x11, 0xb0, 0x1f, 0xe1, 0x9c, 0xd4,
            0xa6, 0xb3, 0x32, 0x2e, 0x80, 0xaa, 0xf5, 0x2b,
            0xf6, 0x44, 0x7e, 0xd1, 0x85, 0x4e, 0x71, 0x00,
            0x1f, 0x4d, 0x54, 0xf8, 0x93, 0x1d
        },
        {
            0xd0, 0x48, 0xee, 0x15, 0x24, 0x01, 0x4a, 0xdf,
            0x9a, 0x56, 0xe6, 0x0a, 0x38, 0x82, 0x77, 0xde,
            0x19, 0x4c, 0x69, 0x4c, 0xc7, 0x87, 0xfc, 0x5a,
            0x1b, 0x55, 0x4e, 0xa9, 0xf0, 0x7a, 0xbf, 0xdf
        }
    },
    {
        376,
        {
            0xc4, 0xad, 0x3c, 0x5e, 0x78, 0xd9, 0x17, 0xec,
            0xb0, 0xcb, 0xbc, 0xd1, 0xc4, 0x81, 0xfc, 0x2a,
            0xaf, 0x23, 0x2f, 0x7e, 0x28, 0x97, 0x79, 0xf4,
            0x0e, 0x50, 0x4c, 0xc3, 0x09, 0x66, 0x2e, 0xe9,
            0x6f, 0xec, 0xbd, 0x20, 0x64, 0x7e, 0xf0, 0x0e,
            0x46, 0x19, 0x9f, 0xbc, 0x48, 0x2f, 0x46
        },
        {
            0x50, 0xdb, 0xf4, 0x00, 0x66, 0xf8, 0xd2, 0x70,
            0x48, 0x4e, 0xe2, 0xef, 0x66, 0x32, 0x28, 0x2d,
            0xfa, 0x30, 0x0a, 0x85, 0xa8, 0x53, 0x0e, 0xce,
            0xeb, 0x0e, 0x04, 0x27, 0x5e, 0x1c, 0x1e, 0xfd
        }
    },
    {
        384,
        {
            0x4e, 0xef, 0x51, 0x07, 0x45, 0x9b, 0xdd, 0xf8,
            0xf2, 0x4f, 0xc7, 0x65, 0x6f, 0xd4, 0x89, 0x6d,
            0xa8, 0x71, 0x1d, 0xb5, 0x04, 0x00, 0xc0, 0x16,
            0x48, 0x47, 0xf6, 0x92, 0xb8, 0x86, 0xce, 0x8d,
            0x7f, 0x4d, 0x67, 0x39, 0x50, 0x90, 0xb3, 0x53,
            0x4e, 0xfd, 0x7b, 0x0d, 0x29, 0x8d, 0xa3, 0x4b
        },
        {
            0x7c, 0x5d, 0x14, 0xed, 0x83, 0xda, 0xb8, 0x75,
            0xac, 0x25, 0xce, 0x7f, 0xee, 0xd6, 0xef, 0x83,
            0x7d, 0x58, 0xe7, 0x9d, 0xc6, 0x01, 0xfb, 0x3c,
            0x1f, 0xca, 0x48, 0xd4, 0x46, 0x4e, 0x8b, 0x83
        }
    },
    {
        392,
        {
            0x04, 0x7d, 0x27, 0x58, 0xe7, 0xc2, 0xc9, 0x62,
            0x3f, 0x9b, 0xdb, 0x93, 0xb6, 0x59, 0x7c, 0x5e,
            0x84, 0xa0, 0xcd, 0x34, 0xe6, 0x10, 0x01, 0x4b,
            0xcb, 0x25, 0xb4, 0x9e, 0xd0, 0x5c, 0x7e, 0x35,
            0x6e, 0x98, 0xc7, 0xa6, 0x72, 0xc3, 0xdd, 0xdc,
            0xae, 0xb8, 0x43, 0x17, 0xef, 0x61, 0x4d, 0x34,
            0x2f
        },
        {
            0x7d, 0x53, 0xec, 0xcd, 0x03, 0xda, 0x37, 0xbf,
            0x58, 0xc1, 0x96, 0x2a, 0x8f, 0x0f, 0x70, 0x8a,
            0x5c, 0x5c, 0x44, 0x7f, 0x6a, 0x7e, 0x9e, 0x26,
            0x13, 0x7c, 0x16, 0x9d, 0x5b, 0xdd, 0x82, 0xe4
        }
    },
    {
        400,
        {
            0x3d, 0x83, 0xdf, 0x37, 0x17, 0x2c, 0x81, 0xaf,
            0xd0, 0xde, 0x11, 0x51, 0x39, 0xfb, 0xf4, 0x39,
            0x0c, 0x22, 0xe0, 0x98, 0xc5, 0xaf, 0x4c, 0x5a,
            0xb4, 0x85, 0x24, 0x06, 0x51, 0x0b, 0xc0, 0xe6,
            0xcf, 0x74, 0x17, 0x69, 0xf4, 0x44, 0x30, 0xc5,
            0x27, 0x0f, 0xda, 0xe0, 0xcb, 0x84, 0x9d, 0x71,
            0xcb, 0xab
        },
        {
            0x99, 0xdc, 0x77, 0x2e, 0x91, 0xea, 0x02, 0xd9,
            0xe4, 0x21, 0xd5, 0x52, 0xd6, 0x19, 0x01, 0x01,
            0x6b, 0x9f, 0xd4, 0xad, 0x2d, 0xf4, 0xa8, 0x21,
            0x2c, 0x1e, 0xc5, 0xba, 0x13, 0x89, 0x3a, 0xb2
        }
    },
    {
        408,
        {
            0x33, 0xfd, 0x9b, 0xc1, 0x7e, 0x2b, 0x27, 0x1f,
            0xa0, 0x4c, 0x6b, 0x93, 0xc0, 0xbd, 0xea, 0xe9,
            0x86, 0x54, 0xa7, 0x68, 0x2d, 0x31, 0xd9, 0xb4,
            0xda, 0xb7, 0xe6, 0xf3, 0x2c, 0xd5, 0x8f, 0x2f,
            0x14, 0x8a, 0x68, 0xfb, 0xe7, 0xa8, 0x8c, 0x5a,
            0xb1, 0xd8, 0x8e, 0xdc, 0xcd, 0xde, 0xb3, 0x0a,
            0xb2, 0x1e, 0x5e
        },
        {
            0xce, 0xfd, 0xae, 0x1a, 0x3d, 0x75, 0xe7, 0x92,
            0xe8, 0x69, 0x8d, 0x5e, 0x71, 0xf1, 0x77, 0xcc,
            0x76, 0x13, 0x14, 0xe9, 0xad, 0x5d, 0xf9, 0x60,
            0x2c, 0x6e, 0x60, 0xae, 0x65, 0xc4, 0xc2, 0x67
        }
    },
    {
        416,
        {
            0x77, 0xa8, 0x79, 0xcf, 0xa1, 0x1d, 0x7f, 0xca,
            0xc7, 0xa8, 0x28, 0x2c, 0xc3, 0x8a, 0x43, 0xdc,
            0xf3, 0x76, 0x43, 0xcc, 0x90, 0x98, 0x37, 0x21,
            0x3b, 0xd6, 0xfd, 0x95, 0xd9, 0x56, 0xb2, 0x19,
            0xa1, 0x40, 0x6c, 0xbe, 0x73, 0xc5, 0x2c, 0xd5,
            0x6c, 0x60, 0x0e, 0x55, 0xb7, 0x5b, 0xc3, 0x7e,
            0xa6, 0x96, 0x41, 0xbc
        },
        {
            0xc9, 0x9d, 0x64, 0xfa, 0x4d, 0xad, 0xd4, 0xbc,
            0x8a, 0x38, 0x95, 0x31, 0xc6, 0x8b, 0x45, 0x90,
            0xc6, 0xdf, 0x0b, 0x90, 0x99, 0xc4, 0xd5, 0x83,
            0xbc, 0x00, 0x88, 0x9f, 0xb7, 0xb9, 0x80, 0x08
        }
    },
    {
        424,
        {
            0x45, 0xa3, 0xe6, 0xb8, 0x65, 0x27, 0xf2, 0x0b,
            0x45, 0x37, 0xf5, 0xaf, 0x96, 0xcf, 0xc5, 0xad,
            0x87, 0x77, 0xa2, 0xdd, 0xe6, 0xcf, 0x75, 0x11,
            0x88, 0x6c, 0x55, 0x90, 0xec, 0xe2, 0x4f, 0xc6,
            0x1b, 0x22, 0x67, 0x39, 0xd2, 0x07, 0xda, 0xbf,
            0xe3, 0x2b, 0xa6, 0xef, 0xd9, 0xff, 0x4c, 0xd5,
            0xdb, 0x1b, 0xd5, 0xea, 0xd3
        },
        {
            0x4d, 0x12, 0xa8, 0x49, 0x04, 0x7c, 0x6a, 0xcd,
            0x4b, 0x2e, 0xee, 0x6b, 0xe3, 0x5f, 0xa9, 0x05,
            0x1b, 0x02, 0xd2, 0x1d, 0x50, 0xd4, 0x19, 0x54,
            0x30, 0x08, 0xc1, 0xd8, 0x2c, 0x42, 0x70, 0x72
        }
    },
    {
        432,
        {
            0x25, 0x36, 0x2a, 0x4b, 0x9d, 0x74, 0xbd, 0xe6,
            0x12, 0x8c, 0x4f, 0xdc, 0x67, 0x23, 0x05, 0x90,
            0x09, 0x47, 0xbc, 0x3a, 0xda, 0x9d, 0x9d, 0x31,
            0x6e, 0xbc, 0xf1, 0x66, 0x7a, 0xd4, 0x36, 0x31,
            0x89, 0x93, 0x72, 0x51, 0xf1, 0x49, 0xc7, 0x2e,
            0x06, 0x4a, 0x48, 0x60, 0x8d, 0x94, 0x0b, 0x75,
            0x74, 0xb1, 0x7f, 0xef, 0xc0, 0xdf
        },
        {
            0xf8, 0xe4, 0xcc, 0xab, 0x6c, 0x97, 0x92, 0x29,
            0xf6, 0x06, 0x6c, 0xc0, 0xcb, 0x0c, 0xfa, 0x81,
            0xbb, 0x21, 0x44, 0x7c, 0x16, 0xc6, 0x87, 0x73,
            0xbe, 0x7e, 0x55, 0x8e, 0x9f, 0x9d, 0x79, 0x8d
        }
    },
    {
        440,
        {
            0x3e, 0xbf, 0xb0, 0x6d, 0xb8, 0xc3, 0x8d, 0x5b,
            0xa0, 0x37, 0xf1, 0x36, 0x3e, 0x11, 0x85, 0x50,
            0xaa, 0xd9, 0x46, 0x06, 0xe2, 0x68, 0x35, 0xa0,
            0x1a, 0xf0, 0x50, 0x78, 0x53, 0x3c, 0xc2, 0x5f,
            0x2f, 0x39, 0x57, 0x3c, 0x04, 0xb6, 0x32, 0xf6,
            0x2f, 0x68, 0xc2, 0x94, 0xab, 0x31, 0xf2, 0xa3,
            0xe2, 0xa1, 0xa0, 0xd8, 0xc2, 0xbe, 0x51
        },
        {
            0x65, 0x95, 0xa2, 0xef, 0x53, 0x7a, 0x69, 0xba,
            0x85, 0x83, 0xdf, 0xbf, 0x7f, 0x5b, 0xec, 0x0a,
            0xb1, 0xf9, 0x3c, 0xe4, 0xc8, 0xee, 0x19, 0x16,
            0xef, 0xf4, 0x4a, 0x93, 0xaf, 0x57, 0x49, 0xc4
        }
    },
    {
        448,
        {
            0x2d, 0x52, 0x44, 0x7d, 0x12, 0x44, 0xd2, 0xeb,
            0xc2, 0x86, 0x50, 0xe7, 0xb0, 0x56, 0x54, 0xba,
            0xd3, 0x5b, 0x3a, 0x68, 0xee, 0xdc, 0x7f, 0x85,
            0x15, 0x30, 0x6b, 0x49, 0x6d, 0x75, 0xf3, 0xe7,
            0x33, 0x85, 0xdd, 0x1b, 0x00, 0x26, 0x25, 0x02,
            0x4b, 0x81, 0xa0, 0x2f, 0x2f, 0xd6, 0xdf, 0xfb,
            0x6e, 0x6d, 0x56, 0x1c, 0xb7, 0xd0, 0xbd, 0x7a
        },
        {
            0xcf, 0xb8, 0x8d, 0x6f, 0xaf, 0x2d, 0xe3, 0xa6,
            0x9d, 0x36, 0x19, 0x5a, 0xce, 0xc2, 0xe2, 0x55,
            0xe2, 0xaf, 0x2b, 0x7d, 0x93, 0x39, 0x97, 0xf3,
            0x48, 0xe0, 0x9f, 0x6c, 0xe5, 0x75, 0x83, 0x60
        }
    },
    {
        456,
        {
            0x4c, 0xac, 0xe4, 0x22, 0xe4, 0xa0, 0x15, 0xa7,
            0x54, 0x92, 0xb3, 0xb3, 0xbb, 0xfb, 0xdf, 0x37,
            0x58, 0xea, 0xff, 0x4f, 0xe5, 0x04, 0xb4, 0x6a,
            0x26, 0xc9, 0x0d, 0xac, 0xc1, 0x19, 0xfa, 0x90,
            0x50, 0xf6, 0x03, 0xd2, 0xb5, 0x8b, 0x39, 0x8c,
            0xad, 0x6d, 0x6d, 0x9f, 0xa9, 0x22, 0xa1, 0x54,
            0xd9, 0xe0, 0xbc, 0x43, 0x89, 0x96, 0x82, 0x74,
            0xb0
        },
        {
            0x4d, 0x54, 0xb2, 0xd2, 0x84, 0xa6, 0x79, 0x45,
            0x81, 0x22, 0x4e, 0x08, 0xf6, 0x75, 0x54, 0x1c,
            0x8f, 0xea, 0xb6, 0xee, 0xfa, 0x3a, 0xc1, 0xcf,
            0xe5, 0xda, 0x4e, 0x03, 0xe6, 0x2f, 0x72, 0xe4
        }
    },
    {
        464,
        {
            0x86, 0x20, 0xb8, 0x6f, 0xbc, 0xaa, 0xce, 0x4f,
            0xf3, 0xc2, 0x92, 0x1b, 0x84, 0x66, 0xdd, 0xd7,
            0xba, 0xca, 0xe0, 0x7e, 0xef, 0xef, 0x69, 0x3c,
            0xf1, 0x77, 0x62, 0xdc, 0xab, 0xb8, 0x9a, 0x84,
            0x01, 0x0f, 0xc9, 0xa0, 0xfb, 0x76, 0xce, 0x1c,
            0x26, 0x59, 0x3a, 0xd6, 0x37, 0xa6, 0x12, 0x53,
            0xf2, 0x24, 0xd1, 0xb1, 0x4a, 0x05, 0xad, 0xdc,
            0xca, 0xbe
        },
        {
            0xdb, 0xa4, 0x90, 0x25, 0x6c, 0x97, 0x20, 0xc5,
            0x4c, 0x61, 0x2a, 0x5b, 0xd1, 0xef, 0x57, 0x3c,
            0xd5, 0x1d, 0xc1, 0x2b, 0x3e, 0x7b, 0xd8, 0xc6,
            0xdb, 0x2e, 0xab, 0xe0, 0xaa, 0xcb, 0x84, 0x6b
        }
    },
    {
        472,
        {
            0xd1, 0xbe, 0x3f, 0x13, 0xfe, 0xba, 0xfe, 0xfc,
            0x14, 0x41, 0x4d, 0x9f, 0xb7, 0xf6, 0x93, 0xdb,
            0x16, 0xdc, 0x1a, 0xe2, 0x70, 0xc5, 0xb6, 0x47,
            0xd8, 0x0d, 0xa8, 0x58, 0x35, 0x87, 0xc1, 0xad,
            0x8c, 0xb8, 0xcb, 0x01, 0x82, 0x43, 0x24, 0x41,
            0x1c, 0xa5, 0xac, 0xe3, 0xca, 0x22, 0xe1, 0x79,
            0xa4, 0xff, 0x49, 0x86, 0xf3, 0xf2, 0x11, 0x90,
            0xf3, 0xd7, 0xf3
        },
        {
            0x02, 0x80, 0x49, 0x78, 0xeb, 0xa6, 0xe1, 0xde,
            0x65, 0xaf, 0xdb, 0xc6, 0xa6, 0x09, 0x1e, 0xd6,
            0xb1, 0xec, 0xee, 0x51, 0xe8, 0xbf, 0xf4, 0x06,
            0x46, 0xa2, 0x51, 0xde, 0x66, 0x78, 0xb7, 0xef
        }
    },
    {
        480,
        {
            0xf4, 0x99, 0xcc, 0x3f, 0x6e, 0x3c, 0xf7, 0xc3,
            0x12, 0xff, 0xdf, 0xba, 0x61, 0xb1, 0x26, 0x0c,
            0x37, 0x12, 0x9c, 0x1a, 0xfb, 0x39, 0x10, 0x47,
            0x19, 0x33, 0x67, 0xb7, 0xb2, 0xed, 0xeb, 0x57,
            0x92, 0x53, 0xe5, 0x1d, 0x62, 0xba, 0x6d, 0x91,
            0x1e, 0x7b, 0x81, 0x8c, 0xca, 0xe1, 0x55, 0x3f,
            0x61, 0x46, 0xea, 0x78, 0x0f, 0x78, 0xe2, 0x21,
            0x9f, 0x62, 0x93, 0x09
        },
        {
            0x0b, 0x66, 0xc8, 0xb4, 0xfe, 0xfe, 0xbc, 0x8d,
            0xc7, 0xda, 0x0b, 0xbe, 0xdc, 0x11, 0x14, 0xf2,
            0x28, 0xaa, 0x63, 0xc3, 0x7d, 0x5c, 0x30, 0xe9,
            0x1a, 0xb5, 0x00, 0xf3, 0xea, 0xdf, 0xce, 0xc5
        }
    },
    {
        488,
        {
            0x6d, 0xd6, 0xef, 0xd6, 0xf6, 0xca, 0xa6, 0x3b,
            0x72, 0x9a, 0xa8, 0x18, 0x6e, 0x30, 0x8b, 0xc1,
            0xbd, 0xa0, 0x63, 0x07, 0xc0, 0x5a, 0x2c, 0x0a,
            0xe5, 0xa3, 0x68, 0x4e, 0x6e, 0x46, 0x08, 0x11,
            0x74, 0x86, 0x90, 0xdc, 0x2b, 0x58, 0x77, 0x59,
            0x67, 0xcf, 0xcc, 0x64, 0x5f, 0xd8, 0x20, 0x64,
            0xb1, 0x27, 0x9f, 0xdc, 0xa7, 0x71, 0x80, 0x3d,
            0xb9, 0xdc, 0xa0, 0xff, 0x53
        },
        {
            0xc4, 0x64, 0xa7, 0xbf, 0x6d, 0x18, 0x0d, 0xe4,
            0xf7, 0x44, 0xbb, 0x2f, 0xe5, 0xdc, 0x27, 0xa3,
            0xf6, 0x81, 0x33, 0x4f, 0xfd, 0x54, 0xa9, 0x81,
            0x46, 0x50, 0xe6, 0x02, 0x60, 0xa4, 0x78, 0xe3
        }
    },
    {
        496,
        {
            0x65, 0x11, 0xa2, 0x24, 0x2d, 0xdb, 0x27, 0x31,
            0x78, 0xe1, 0x9a, 0x82, 0xc5, 0x7c, 0x85, 0xcb,
            0x05, 0xa6, 0x88, 0x7f, 0xf2, 0x01, 0x4c, 0xf1,
            0xa3, 0x1c, 0xb9, 0xba, 0x5d, 0xf1, 0x69, 0x5a,
            0xad, 0xb2, 0x5c, 0x22, 0xb3, 0xc5, 0xed, 0x51,
            0xc1, 0x0d, 0x04, 0x7d, 0x25, 0x6b, 0x8e, 0x34,
            0x42, 0x84, 0x2a, 0xe4, 0xe6, 0xc5, 0x25, 0xf8,
            0xd7, 0xa5, 0xa9, 0x44, 0xaf, 0x2a
        },
        {
            0xd6, 0x85, 0x9c, 0x0b, 0x5a, 0x0b, 0x66, 0x37,
            0x6a, 0x24, 0xf5, 0x6b, 0x2a, 0xb1, 0x04, 0x28,
            0x6e, 0xd0, 0x07, 0x86, 0x34, 0xba, 0x19, 0x11,
            0x2a, 0xce, 0x0d, 0x6d, 0x60, 0xa9, 0xc1, 0xae
        }
    },
    {
        504,
        {
            0xe2, 0xf7, 0x6e, 0x97, 0x60, 0x6a, 0x87, 0x2e,
            0x31, 0x74, 0x39, 0xf1, 0xa0, 0x3f, 0xcd, 0x92,
            0xe6, 0x32, 0xe5, 0xbd, 0x4e, 0x7c, 0xbc, 0x4e,
            0x97, 0xf1, 0xaf, 0xc1, 0x9a, 0x16, 0xfd, 0xe9,
            0x2d, 0x77, 0xcb, 0xe5, 0x46, 0x41, 0x6b, 0x51,
            0x64, 0x0c, 0xdd, 0xb9, 0x2a, 0xf9, 0x96, 0x53,
            0x4d, 0xfd, 0x81, 0xed, 0xb1, 0x7c, 0x44, 0x24,
            0xcf, 0x1a, 0xc4, 0xd7, 0x5a, 0xce, 0xeb
        },
        {
            0x18, 0x04, 0x1b, 0xd4, 0x66, 0x50, 0x83, 0x00,
            0x1f, 0xba, 0x8c, 0x54, 0x11, 0xd2, 0xd7, 0x48,
            0xe8, 0xab, 0xbf, 0xdc, 0xdf, 0xd9, 0x21, 0x8c,
            0xb0, 0x2b, 0x68, 0xa7, 0x8e, 0x7d, 0x4c, 0x23
        }
    },
    {
        512,
        {
            0x5a, 0x86, 0xb7, 0x37, 0xea, 0xea, 0x8e, 0xe9,
            0x76, 0xa0, 0xa2, 0x4d, 0xa6, 0x3e, 0x7e, 0xd7,
            0xee, 0xfa, 0xd1, 0x8a, 0x10, 0x1c, 0x12, 0x11,
            0xe2, 0xb3, 0x65, 0x0c, 0x51, 0x87, 0xc2, 0xa8,
            0xa6, 0x50, 0x54, 0x72, 0x08, 0x25, 0x1f, 0x6d,
            0x42, 0x37, 0xe6, 0x61, 0xc7, 0xbf, 0x4c, 0x77,
            0xf3, 0x35, 0x39, 0x03, 0x94, 0xc3, 0x7f, 0xa1,
            0xa9, 0xf9, 0xbe, 0x83, 0x6a, 0xc2, 0x85, 0x09
        },
        {
            0x42, 0xe6, 0x1e, 0x17, 0x4f, 0xbb, 0x38, 0x97,
            0xd6, 0xdd, 0x6c, 0xef, 0x3d, 0xd2, 0x80, 0x2f,
            0xe6, 0x7b, 0x33, 0x19, 0x53, 0xb0, 0x61, 0x14,
            0xa6, 0x5c, 0x77, 0x28, 0x59, 0xdf, 0xc1, 0xaa
        }
    }
};

/* clang-format on */

/**
 * @brief   Common unit test function for SHA256 using Ockam Vault
 * @param   state   Contains a pointer to shared data for all SHA-256 test cases.
 */
void test_vault_sha256(void** state)
{
  test_vault_sha256_shared_data_t* test_data                                    = 0;
  size_t                           length                                       = 0;
  uint8_t                          sha256_digest[TEST_VAULT_SHA256_DIGEST_SIZE] = { 0 };

  test_data = (test_vault_sha256_shared_data_t*) *state;

  if (test_data->test_count >= test_data->test_count_max) {
    fail_msg("Test count %d has exceeded max test count of %d", test_data->test_count, test_data->test_count_max);
  }

  ockam_error_t error = ockam_vault_sha256(test_data->vault,
                             (&(g_sha256_data[test_data->test_count].msg[0])),
                             (g_sha256_data[test_data->test_count].len / 8),
                             &sha256_digest[0],
                             TEST_VAULT_SHA256_DIGEST_SIZE,
                             &length);
  assert_true(ockam_error_is_none(&error));
  assert_int_equal(length, TEST_VAULT_SHA256_DIGEST_SIZE);

  assert_memory_equal(
    &(g_sha256_data[test_data->test_count].digest[0]), &sha256_digest[0], TEST_VAULT_SHA256_DIGEST_SIZE);
}

/**
 * @brief   Common unit test teardown function for SHA256 using Ockam Vault
 * @param   state[in] Contains a pointer to shared data for all SHA-256 test cases.
 */
int test_vault_sha256_teardown(void** state)
{
  test_vault_sha256_shared_data_t* test_data = 0;

  test_data = (test_vault_sha256_shared_data_t*) *state;
  test_data->test_count++;

  return 0;
}

/**
 * @brief   Triggers SHA-256 unit tests using Ockam Vault.
 * @return  Zero on success. Non-zero on failure.
 */
int test_vault_run_sha256(ockam_vault_t* vault, ockam_memory_t* memory)
{
  int                             rc           = 0;
  char*                           test_name    = 0;
  uint16_t                        i            = 0;
  uint8_t*                        cmocka_data  = 0;
  struct CMUnitTest*              cmocka_tests = 0;
  test_vault_sha256_shared_data_t shared_data;

  ockam_error_t error = ockam_memory_alloc_zeroed(
    memory, (void**) &cmocka_data, (TEST_VAULT_SHA256_TEST_CASES * sizeof(struct CMUnitTest)));
  if (ockam_error_has_error(&error)) {
    rc = -1;
    goto exit;
  }

  cmocka_tests = (struct CMUnitTest*) cmocka_data;

  shared_data.test_count     = 0;
  shared_data.test_count_max = TEST_VAULT_SHA256_TEST_CASES;

  shared_data.vault  = vault;
  shared_data.memory = memory;

  for (i = 0; i < TEST_VAULT_SHA256_TEST_CASES; i++) {
    error = ockam_memory_alloc_zeroed(memory, (void**) &test_name, TEST_VAULT_SHA256_NAME_SIZE);
    if (ockam_error_has_error(&error)) {
      rc = -1;
      goto exit;
    }

    snprintf(test_name, TEST_VAULT_SHA256_NAME_SIZE, "SHA-256 Test Case %02d", i);

    cmocka_tests->name          = test_name;
    cmocka_tests->test_func     = test_vault_sha256;
    cmocka_tests->setup_func    = 0;
    cmocka_tests->teardown_func = test_vault_sha256_teardown;
    cmocka_tests->initial_state = &shared_data;

    cmocka_tests++;
  }

  if (ockam_error_has_error(&error)) {
    rc = -1;
    goto exit;
  }

  cmocka_tests = (struct CMUnitTest*) cmocka_data;

  rc = _cmocka_run_group_tests("SHA-256", cmocka_tests, shared_data.test_count_max, 0, 0);

exit:
  return rc;
}
